home *** CD-ROM | disk | FTP | other *** search
- LIBELFUTIL(5) Last changed: 1-7-99
-
-
- NNAAMMEE
- lliibbeellffuuttiill - Library for xxllaattee sections and lleebb112288 numbers
-
- SSYYNNOOPPSSIISS
- ##iinncclluuddee <<lliibbXXllaattee..hh>>
- ##iinncclluuddee <<ccmmppllrrss//lleebb112288..hh>>
-
- IIMMPPLLEEMMEENNTTAATTIIOONN
- IRIX systems
-
- DDEESSCCRRIIPPTTIIOONN
- This library is a collection of functions that can be divided into
- three groups: the xxllaattee functions used to create and access the
- ..MMIIPPSS..xxllaattee and related sections, the lleebb112288 functions, and a
- disassembly function (undocumented).
-
- The following is a description of the xxllaattee routines. The xxllaattee
- routines are used to create and access address translation data as
- described in xxllaattee(4).
-
- Calls used to create address translation data are called "producer"
- calls. Calls used to create applications that read the address
- translation data are called "consumer" calls.
-
- Use --lleellffuuttiill --lleellff on the link command line to link in lliibbeellffuuttiill.
-
- All call interfaces described on this man page pass and return values
- sufficient for both 32 and 64 bit executables and DSOs. On disk, the
- data format is slightly different for 32 and 64 bit executables and
- DSOs, but there is only one library interface.
-
- xxllaattee CCoonnssuummeerr IInntteerrffaaccee
- The xxllaattee consumer interface is used by debuggers and other tools that
- want to know, for a transformed executable or DSO, what given
- execution time addresses were in the original program text (executable
- instructions). Or that want to know, for a given address taken from
- the debugging information, what address this represents in the
- transformed text (the debugging information is not changed by
- transformations, so the debugging information give addresses which are
- not identical to the executing transformed text).
-
- The following code ignores return values to keep the examples small.
-
- The following example gets the untransformed address for a range of
- transformed addresses.
-
- int result;
- xlate_table_con contable = 0;
- xlate_block range;
- result = xlate_init_fd(myopenfd,
- XLATE_OPEN_STD_TABLE,&contable);
- for(pc = startpc; pc <endpc; pc += 4)
- {
- Elf64_Addr oldaddress;
- xlate_Block range;
- result = xlate_address(contable,
- XLATE_ADDRESS_INPUT_NEW_ADDRESS,
- pc,&oldaddress,&range);
- ...do something useful here...
- }
- result = xlate_finish(contable);
-
- xxllaattee PPrroodduucceerr IInntteerrffaaccee
- The xxllaattee producer interface is used by transforming applications
- (like ccoorrdd(1) and ppiixxiiee(1)) to register the transformations so other
- tools [like ddbbxx(1)] can, at execution time, use the "Consumer
- Interface" to help the tool user understand the transformed text.
-
- The following example records a trivial transformation and gets back
- the transformed bytes.
-
- int result;
- xlate_table_con contable = 0;
- xlate_table_pro protable = 0;
- result = xlate_pro_init(&protable,xlate_tk_general,contable,
- /*is64bit= */0);
- /* the single transformation */
- result = xlate_pro_add_range(protable,newpc,newrange,
- oldpc, oldrange);
- result = xlate_pro_disk_header(protable,
- XLATE_PRO_STANDARD_SETUP,
- &totalmemory, &numblocks);
- for(i = 0; i < numblocks; ++i)
- {
- result = xlate_pro_disk_next_block(protable,
- &data,&datasize);
- /* do something with datasize bytes at address data */
- free(data);
- }
- result = xlate_pro_finish(protable);
-
- You must install the ccoommppiilleerr__eeooee..hhddrr..iinntteerrnnaall subsystem to get the
- headers necessary to work with the xxllaattee functions and lleebb112288
- functions they call.
-
- FFIILLEESS
- //uussrr//iinncclluuddee//lliibbXXllaattee..hh
- //uussrr//iinncclluuddee//ccmmppllrrss//xxllaattee..hh
- //uussrr//iinncclluuddee//eellff..hh
- //uussrr//iinncclluuddee//ddwwaarrff..hh
- //uussrr//iinncclluuddee//lliibbddwwaarrff..hh
- //uussrr//lliibb//lliibbeellffuuttiill..aa
-
- SSEEEE AALLSSOO
- xxllaattee__iinniitt__ffdd(3e), xxllaattee__pprroo__iinniitt(3e)
-
- xxllaattee(4)
-
- This man page is available only online.
-